package com.itheima.app.interceptor;

import com.itheima.domain.db.User;

public class UserHolder {

    private static final ThreadLocal<User> THREAD_LOCAL = new ThreadLocal<>();

    // 设置user
    public static void set(User user) {
        THREAD_LOCAL.set(user);
    }

    // 获取user
    public static User get() {
        return THREAD_LOCAL.get();
    }

    // 删除user
    public static void remove() {
        THREAD_LOCAL.remove();
    }
}
